import Vue from 'vue';
import VueRouter from 'vue-router';
import Login from '../views/Login';
import Register from '../views/Register';
import Study from '../views/study';
import Content from '../views/content';
import Manage from '../views/manage';
import Guanliyuanguanli from '../views/guanliyuanguanli';
import Xueshengguanli from '../views/xueshengguanli';
import Xueshengliebiao from '../components/xueshengliebiao';
import Kechengbanjiguanli from '../components/kechengbanjiguanli';
import Guanliyuanliebiao from '../components/guanliyuanliebiao';
import Ketangneironggaunli from '../views/ketangneironggaunli';
import Ketangneironggaunlishu from '../components/ketangneirongguanlishu';
import Kehouzuoyeguanli from '../components/kehouzuoyeguanli';
import Kejianbianji from '../components/kejianbianji';
import Homework from '../components/homework';
import PublishHomework from '../components/publishHomework';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login,
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
  },
  {
    path: '/study',
    name: 'study',
    component: Study,
    children: [
      {
        path: 'content/:key',
        name: 'Content',
        component: Content,
      },
      {
        path: 'homework',
        name: 'Homework',
        component: Homework,
      },
    ],
  },
  {
    path: '/manage',
    name: 'manage',
    component: Manage,
    children: [
      {
        path: 'guanliyuanguanli',
        name: 'guanliyuanguanli',
        component: Guanliyuanguanli,
        children: [
          {
            path: 'guanliyuanliebiao',
            name: 'guanliyuanliebiao',
            component: Guanliyuanliebiao,
          },
        ],
      },
      {
        path: 'xueshengguanli',
        name: 'xueshengguanli',
        component: Xueshengguanli,
        children: [
          {
            path: 'xueshengliebiao',
            name: 'xueshengliebiao',
            component: Xueshengliebiao,
          },
          {
            path: 'kechengbanjiguanli',
            name: 'kechengbanjiguanli',
            component: Kechengbanjiguanli,
          },
        ],
      },
      {
        path: 'ketangneirongguanli',
        name: 'ketangneirongguanli',
        component: Ketangneironggaunli,
        children: [
          {
            path: 'ketangneirongguanlishu',
            name: 'ketangneirongguanlishu',
            component: Ketangneironggaunlishu,
          },
          {
            path: 'kehouzuoyeguanli',
            name: 'kehouzuoyeguanli',
            component: Kehouzuoyeguanli,
          },
          {
            path: 'kejianbianji',
            name: 'kejianbianji',
            component: Kejianbianji,
          },
        ],
      },
      {
        path: 'publishHomework',
        name: 'publishHomework',
        component: PublishHomework,
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
